const todos = (state = [], action) => {
    switch(action.type) {
        case 'ADD_TODO':
            return[
                ...state, {
                    id: action.id,
                    values: action.values,
                    markDone: false,
                }
            ]
        case 'GET_ID':
            return "hallo"
        case 'MARK_DONE':
            return state.map(todo =>
                todo.id === action.id ? { ...todo, completed: !todo.completed } : todo
                );
                        case 'EDIT_TODO':
            return {...state, values: {...state.values, ...action.values}}
        default:
            return state
    }
}
export default todos;
